import request from '@/utils/request.js'

export function getTopBanners() {
    return request({
        url: '/banner',
        method: 'get'
    })
}

export function getHotRecommends(limit = 8) {
    return request({
        url: '/personalized',
        params: {
            limit
        }
    })
}

export function getUserInfo() {
    return request({
        url:'/user/subcount'
    })
}

export function login(data) {
    return request({
        url:'/login/cellphone',
        method:'post',
        data
    })
}

export function getNewAlbums(limit = 10) {
    return request({
        url:'/album/new',
        params:{
            limit
        }
    })
}

export function getRankings(index = 0,limit = 10){
    //飙升榜  新歌榜  原创榜
    const ids = ['19723756','3779629','2884035']
    return request({
        url:'/playlist/detail',
        params:{
            id:ids[index],
            s:limit
        }
    })
}